﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesignPatternDemoCApp.Behavioral.VisitorPattern
{
    /// <summary>
    /// 具体访问者 ConcreteVisitor
    /// </summary>
    public sealed class CustomVisitor : ShapeVisitor
    {
        //针对Rectangle对象
        public override void VisitRectangle(Rectangle shape)
        {
            //比如增加一个旋转当前图形的方法
            Console.WriteLine("针对Rectangle新的旋转90度操作！");
        }
        //针对Circle对象
        public override void VisitCircle(Circle shape)
        {
            Console.WriteLine("针对Circle新的旋转180度操作！");
        }
        //针对Line对象
        public override void VisitLine(Line shape)
        {
            Console.WriteLine("针对Line新的旋转270度操作！");
        }
    }
}
